package com.raojunxue.company.action.talk;

import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;

import com.raojunxue.company.action.AbstractAction;
import com.raojunxue.company.util.XMPPUtil;

public class InviteAction extends AbstractAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3588760538713056274L;

	private String jid;

	private String status;
	
	@Override
	public HttpHeaders create() {
		boolean result = XMPPUtil.invite(this.jid);
		this.status = result ? "SUCCESS" : "FAILURE"; 
		return new DefaultHttpHeaders("index").disableCaching();
	}

	@Override
	public String destroy() {
		return null;
	}

	@Override
	public String edit() {
		return null;
	}

	@Override
	public HttpHeaders editNew() {
		return null;
	}

	@Override
	public HttpHeaders index() {
		return new DefaultHttpHeaders("index").disableCaching();
	}

	@Override
	public HttpHeaders show() {
		return null;
	}

	@Override
	public String update() {
		return null;
	}

	public void setJid(String jid) {
		this.jid = jid;
	}

	public String getStatus() {
		return status;
	}
	
}
